package cmsoa.action.system;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import cmsoa.db.DBUtil;
import cmsoa.db.pojo.TXtHelp;
import cmsoa.db.pojo.TXtUser;
import cmsoa.helper.RequestHelper;

import com.opensymphony.xwork2.Action;

public class HelpAction {
	private String menuId;
	private String url;
	
	public String queryHelpUrl(){
		TXtUser curruser = (TXtUser)RequestHelper.getSession().getAttribute("user");
		DBUtil db = DBUtil.getDBUtilByRequest();
		Map params = new HashMap(2);
		params.put("id.menuId", menuId);
		params.put("id.userType", "default");//暂时是默认的，以后就使用当前用户类型
		List<TXtHelp> list = db.queryByPojo(TXtHelp.class, params);
		if(list.size()>0){
			url = list.get(0).getUrl();
		}
		return Action.SUCCESS;
	}

	public String save(){
		return Action.SUCCESS;
	}
	
	public String delete(){
		return Action.SUCCESS;
	}
	
	public String getUrl() {
		return url;
	}

	public String getMenuId() {
		return menuId;
	}

	public void setMenuId(String menuId) {
		this.menuId = menuId;
	}
	
}
